import { download, post } from '@/utils/request'

/**
 * 导出
 * @param data
 */
export function exportExcel(data) {
  return download('/api/stat/exam/export', data, '统计总览-导出.xlsx')
}

/**
 * 统计总览数据
 * @param examId
 * @returns {Promise}
 */
export function apiExamOverview(examId) {
  return post('/api/stat/exam/overview', { id: examId })
}

/**
 * 题库详情
 * @param data
 */
export function apiExportUser(params) {
  return download('/api/stat/exam/user-export', { current: 1, size: 10000, params: params }, '用户考试情况.xls')
}

/**
 * 部门统计树
 * @param data
 * @returns {Promise}
 */
export function apiStatDepartTree(data) {
  return post('/api/stat/exam/tree-list', data)
}

/**
 * 导出部门统计
 * @param data
 * @returns {Promise | Promise<unknown>}
 */
export function apiStatDepartExport(data) {
  return download('/api/stat/exam/tree-export', data, '部门成绩统计.xlsx')
}

/**
 * 导出错题统计
 * @param data
 * @returns {Promise | Promise<unknown>}
 */
export function apiErrorQuExport(data) {
  return download('/api/stat/exam/error-qu-export', data, '考试错题统计.xlsx')
}
